package org.hepeng.hope.entity

import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test

internal class AccountTest {



    @Test fun accountInitTest() {

        val fields = Account::class.java.declaredFields.asSequence().map { it.name }.toList()
        println(fields)
        assertTrue("id" in fields)
    }

    @Test fun test() {

        val a1 = Account("xiaoming" , "xiaoming@gmail.com").apply {
            id = 1
            createTime = System.currentTimeMillis()
        }


        val a2 = Account("xiaoming" , "xiaoming@gmail.com").apply {
            id = 2
            createTime = System.currentTimeMillis()
        }

        var isEq = a1 == a2
        println("a1 equals a2 = $isEq")
        println("a1 hash code ${a1.hashCode()}")
        println("a2 hash code ${a2.hashCode()}")

        println("a1 toString : $a1.")
        println("a2 toString : $a2")

        assertTrue(isEq)
    }
}

